from sqlalchemy import ForeignKey, String
from sqlalchemy.dialects.postgresql import TIMESTAMP, UUID
from sqlalchemy.orm import Mapped, mapped_column

from .base_model import OrmBase
from .package import Package


class Document(OrmBase):
    __tablename__ = 'document'

    uuid: Mapped[str] = mapped_column(String(70), primary_key=True)
    package_uuid: Mapped[str] = mapped_column(
        UUID(as_uuid=True),
        ForeignKey(Package.uuid),
    )

    def __repr__(self) -> str:
        return (
            f'Document(uuid={self.uuid!r}, package_uuid={self.package_uuid!r})'
        )
